﻿using System;
using System.Data;

#if NET20
namespace System.Net20.Tests
#elif NET35
namespace System.Net35.Tests
#elif NET40
namespace System.Net40.Tests
#elif NET45
namespace System.Net45.Tests
#elif NET451
namespace System.Net451.Tests
#elif PORTABLE40
namespace System.Portable40.Tests
#elif PORTABLE45
namespace System.Portable40.Tests
#endif
{
	public class TestDataItem
	{
		public DateTime DateTime { get; set; }
		public int Hour { get; set; }
		public int Minute { get; set; }
		public int Second { get; set; }

		public static TestDataItem FromDataRow(DataRow row)
		{
			return new TestDataItem()
			{
				DateTime = (DateTime)row["DateTime"],
				Hour = Convert.ToInt32(row["Hour"]),
				Minute = Convert.ToInt32(row["Minute"]),
				Second = Convert.ToInt32(row["Second"]),
			};
		}

		public TimeSpan TimeSpan
		{
			get
			{
				return this.DateTime.TimeOfDay;
			}
		}

		public string LongTimeString
		{
			get
			{
				return this.DateTime.ToString("hh:mm:ss tt");
			}
		}

		public string ShortTimeString
		{
			get
			{
				return this.DateTime.ToString("t");
			}
		}
	}
}
